package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.Dept;

import java.util.List;

@Mapper
public interface DeptMapper {
    /**
     * 查询部门全部数据
     */
    @Select("select * from tb_dept")
    List<Dept> list();

    @Delete("delete from tb_dept where id = #{id}")
    void deleteById(Integer id);

    @Insert("insert into tb_dept(name, create_time, update_time) values(#{name}, #{createTime}, #{updateTime})")
    void add(Dept dept);
}
